package cn.com.callback;
import groovy.json.*;
import groovy.swing.impl.DefaultAction;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;
import cn.com.elite.EliteBean;
import java.security.MessageDigest;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.wisdge.dataservice.Result;
import java.util.Map;
import java.util.Date;
import java.util.HashMap;

import org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;

import cn.com.elite.Util;
import cn.com.kh.getProperty;
import cn.com.kh.KHUtil;

/**
 *
 * @Title: autoHstSendEmailWorkorder
 * @Description: 华盛证券，自动任务 发送Esop邮箱配置启用下的邮件任务
 * @author: chieh
 * @date 2023-11-08 12:50
 *
 */

public class autoHstSendEmailWorkorder implements CallBackInvoke{
	private static final Log log=LogFactory.getLog(autoHstSendEmailWorkorder.class);
	
	public void doCallBack(EliteBean eliteBean,String callBack,Map map,String body) {
		
        log.debug("-------------------------start autoHstSendEmailWorkorder 开始调用 -----------------");

		try {
			Map<String, String> headMap = new HashMap<String, String>();
			headMap.put("Content-Type", "application/json");
			//获取配置参数
			String sysurl1 = getProperty.get("crmurl");//配置本地接口地址
			sysurl1 = sysurl1+"apiSync_refresh_token";
			//华盛证券，自动刷新Esop邮件token
			Util.doHttpPostUseHead(sysurl1,"{}","UTF-8",100000,0,headMap);
		} catch (Exception e) {
			log.error("获取刷新的token接口处理异常" + e.getMessage());
		}

		try {
			Map<String, String> headMap = new HashMap<String, String>();
			headMap.put("Content-Type", "application/json");
			//获取配置参数
			String sysurl = getProperty.get("crmurl");//配置本地接口地址
			//华盛证券，自动任务 发送Esop邮箱配置启用下的邮件任务
			sysurl = sysurl+"apiHstSendEmailWorkorder";
			Util.doHttpPostUseHead(sysurl,"{}","UTF-8",100000,0,headMap);
		} catch (Exception e) {
			log.error("发送邮件接口处理异常" + e.getMessage());
		}
	}
}